package org.example.compare.dto;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class OrderProcess {
    long orderProcessId;  // 订单工序ID，t_order_process.order_process_id
    long miStyleTypePartId;//款式部件id，指向部件名，[zj02f02].[t_process].style_type_part_id
    Long mPartId;//部件Id，
    Integer partType; //部件类型，0默认，1组合
    long processId; //工序id
    String processCode;
    String mProcessBrief;//工序简称
    String mProcessDetail;//工序详情
    String mProcessType;//做工类型，
    long miProcessLevelId;//工序等级
    Long mMachineTypeId;//机器类型Id
    String machineType;//机器类型
    float mfProcessTotalTime;//总工时,用于工序各种计算不用标准工时
    int miFinishedCnt;//已完成件数
    boolean mbCompletedFlag;//完成标志
    int miPartSeqNum;//工序在部件中的工作顺序
    int miProcessAttri;//附加属性

    ProcessSch mScheduling;//排产数据，新增
    String mLocalOrderNumber;//新增
    String mDepandencyStr = "";//新增
    String allDependency;
    //List<Integer> dependencyId;
    List<TemplateCar> lTemplateCar = new ArrayList<>();
    //Order pOrder;//所在的订单
    String mLocalOrderNum;
    String mOuterOrderNum;
    int urgentLevel;

    public static OrderProcess InitOrderProcess(OrderDto order) {
        OrderProcess pOut = new OrderProcess();
        pOut.miStyleTypePartId = 0;
        pOut.mPartId = 0L;
        pOut.mProcessBrief = "";
        pOut.mProcessDetail = "";
        pOut.mProcessType = "";
        pOut.miProcessLevelId = 0;
        pOut.mMachineTypeId = 0L;
        pOut.mfProcessTotalTime = 0.0f;
        pOut.miFinishedCnt = 0;
        pOut.mbCompletedFlag = false;
        pOut.miPartSeqNum = 0;
        pOut.miProcessAttri = 0;
        pOut.mScheduling = null;
        pOut.mLocalOrderNumber = order == null ? "" : order.mLocalOrderNum;
        pOut.mDepandencyStr = "";
        pOut.urgentLevel = 0;
        //pOut.pOrder = order;
        pOut.mLocalOrderNum = order.getMLocalOrderNum();
        pOut.mOuterOrderNum = order.getMOuterOrderNum();
        return pOut;
    }

}
